<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/7/16 0016
  Time: 14:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
    <c:choose>
        <c:when test="${shop.shopStatus==1||userIdentity==1||returnResult==1}">
            <title>店铺缴费</title>
        </c:when>
        <c:otherwise>
            <title>开通微店</title>
        </c:otherwise>
    </c:choose>
    <style>
        .num_error{  right:0.5rem; top:0; color:#cb1448;}
    </style>
    <script src="${ctx}/assets/public_skin/js/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script>
        $(function ($) {
            $("#addrProvinceCode").children("option").remove();
            $("#addrCityCode").children("option").remove();
            $("#addrDistrictCode").children("option").remove();
            $("#addrProvinceCode").append("<option value=''>"+"请选择省"+"</option>");
            $("#addrCityCode").append("<option value=''>"+"请选择市"+"</option>");
            $("#addrDistrictCode").append("<option value=''>"+"请选择县、区"+"</option>");
            $.getJSON("${ctx}/ajax/get_area?parentCode=", function(json){
                //alert("JSON Data: " +json);
                //alert(json.length);
                for(var i in json){
                    //alert(json[i].areaName);
                    $("#addrProvinceCode").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
            });

            //省市发生改变时
            $("#addrProvinceCode").change(function () {
                $("#addrCityCode").children("option").remove();
                $("#addrDistrictCode").children("option").remove();
                $("#addrCityCode").append("<option value=''>"+"请选择市"+"</option>");
                $("#addrDistrictCode").append("<option value=''>"+"请选择县、区"+"</option>");
                var selectTmp=$("#addrProvinceCode").val();
                if(selectTmp!=0){
                    $.getJSON("${ctx}/ajax/get_area?parentCode="+selectTmp, function(json){
                        //alert("JSON Data: " +json);
                        for(var i in json){
                            //alert(json[i].areaName);
                            $("#addrCityCode").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
                    });
                }
            })
            //市区发生改变时
            $("#addrCityCode").change(function () {
                $("#addrDistrictCode").children("option").remove();
                $("#addrDistrictCode").append("<option value=''>"+"请选择县、区"+"</option>");
                var selectTmp=$("#addrCityCode").val();
                if(selectTmp!=0){
                    $.getJSON("${ctx}/ajax/get_area?parentCode="+selectTmp, function(json){
                        //alert("JSON Data: " +json);
                        for(var i in json){
                            //alert(json[i].areaName);
                            $("#addrDistrictCode").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
                    });
                }
            })

        })
    </script>
    <script>
        function numberForm() {
            document.form1.submit();
        }
    </script>

</head>

<body>
<c:choose>
    <c:when test="${shop.shopStatus==1}">
        <article class="viewports">
            <ul class="imglist01 lh1-5">
                <li class="odr_b mb10">
                    <div class="c0"><i class="ico_tip b-ffaa3b"></i>费用明细：</div>
                    <div class="c8 pl20">
                        <p>1、技术服务费￥1000元/年。</p>
                        <p>2、交易服务费5%。</p>
                    </div>
                </li>
            </ul>
            <ul class="list_item c6">
                <li class="odr2_b plr20">
                    <span>代支付</span>
                    <span class="r c-cb1448">￥1000<i class="ico-30 ico_arrow _mt10"></i></span>
                </li>
            </ul>
            <div class="p40 login_reg">
                <a href="${ctx}/wx/shop_success?shopId=${shop.shopId}">
                <div >
                    <button class="i_btn b-2db22d cf r5 lh2">微信支付</button>
                </div>
                </a>
            </div>
        </article>
    </c:when>
    <c:when test="${userIdentity==1}">
        <article class="viewports">
            <ul class="imglist01 lh1-5">
                <li class="odr_b mb10">
                    <div class="c8 pl20">
                        <p>1、您已经申请不能重复申请。</p>
                    </div>
                </li>
            </ul>
        </article>
    </c:when>
    <c:when test="${returnResult==1}">
<article class="viewports">
    <ul class="imglist01 lh1-5">
        <li class="odr_b mb10">
            <div class="c0"><i class="ico_tip b-ffaa3b"></i>费用明细：</div>
            <div class="c8 pl20">
                <p>1、技术服务费￥1000元/年。</p>
                <p>2、交易服务费5%。</p>
            </div>
        </li>
    </ul>
    <ul class="list_item c6">
        <li class="odr2_b plr20">
            <span>代支付</span>
            <span class="r c-cb1448">￥1000<i class="ico-30 ico_arrow _mt10"></i></span>
        </li>
    </ul>
    <a href="${ctx}/wx/shop_success?shopId=${wxShop.shopId}">
    <div class="p40 login_reg">
        <div >
            <button class="i_btn b-2db22d cf r5 lh2">微信支付</button>
        </div>
    </div>
        </a>
</article>
    </c:when>
    <c:otherwise>
        <form:form modelAttribute="WxShopModel" method="post" class="text-form" name="form1">
            <article class="viewports">
                <ul class="imglist01 lh1-5">
                    <li class="odr_b mb10">
                        <div class="c0"><i class="ico_tip b-ffaa3b"></i>特色功能：</div>
                        <div class="c8 pl20">
                            <p>1、可绑定微信公众号的微商城。</p>
                            <p>2、交易信息微信通知。</p>
                            <p>3、强大的分销系统。</p>
                        </div>
                    </li>
                    <li class="odr_b mb10">
                        <div class="c0"><i class="ico_tip b-ffaa3b"></i>特色服务：</div>
                        <div class="c8 pl20">
                            <p>1、强大的媒体资源（创始人记者出身）。</p>
                            <p>2、微店金融服务，没有钱也可以开店（创始人央行下属企业高管）。</p>
                            <p>3、B2B商品资源互推。</p>
                        </div>
                    </li>

                    <li class="odr_b mb10">
                        <div class="c0"><i class="ico_tip b-ffaa3b"></i>开通微店申请：</div>
                        <div class="c8">
                            <div class="odr2 plr10 mt20" id="name-label">
                                <form:input path="shopName" cssClass="i_text" placeholder="店铺名称"></form:input>
                                    <%--<input class="i_text" type="text" value="" placeholder="联系人">--%>
                            </div>
                            <form:errors path="shopName" cssClass="num_error"></form:errors>
                            <div class="odr2 plr10 mt20" id="name-label">
                                <form:input path="shopMainProduct" cssClass="i_text" placeholder="店铺主营"></form:input>
                                    <%--<input class="i_text" type="text" value="" placeholder="联系人">--%>
                            </div>
                            <form:errors path="shopMainProduct" cssClass="num_error"></form:errors>
                            <div class="odr2 plr10 mt20" id="name-label">
                                <form:input path="name" cssClass="i_text" placeholder="联系人"></form:input>
                                    <%--<input class="i_text" type="text" value="" placeholder="联系人">--%>
                            </div>
                                <form:errors path="name" cssClass="num_error"></form:errors>
                            <div class="odr2 plr10 mt20" id="phone-label">
                                <form:input path="phone" cssClass="i_text" placeholder="联系方式"></form:input>
                                    <%--<input class="i_text" type="text" value="" placeholder="联系方式">--%>
                            </div>
                                <form:errors path="phone" cssClass="num_error"></form:errors>
                            <div class="odr2 plr10 mt20" id="city_demo">
                        <span class="c0">
                            <tr>
                        <form:select path="addrProvinceCode" class="s_text">
                        </form:select>
                            </tr>
                             <tr>
                        <form:select path="addrCityCode" class="s_text">
                        </form:select>
                            </tr>
                              <tr>
                        <form:select path="addrDistrictCode" class="s_text">
                        </form:select>
                            </tr>
                    <input id="value1" type="hidden" value="20,234,504"/>
                    </span>
                        <span class="r">
                        <i class="ico-30 ico_arrow"></i>
                        </span>
                    </div>
                            <form:errors path="addrProvinceCode" cssClass="num_error"></form:errors>
                            <form:errors path="addrCityCode" cssClass="num_error"></form:errors>
                            <form:errors path="addrDistrictCode" cssClass="num_error"></form:errors>
                    <div class="odr2 p10 mt20" id="shopSummary-label">
                        <form:textarea path="shopSummary" cssClass="i_textarea" style="height:4rem;"
                                       placeholder="申请理由"></form:textarea>
                            <%--<textarea class="i_textarea" style="height:4rem;" placeholder="简单介绍一下您成为代理商的优势和成为代理商之后的做法"></textarea>--%>
                    </div>
                          <form:errors path="shopSummary" cssClass="num_error"></form:errors>
                    </div>
                    </li>
                </ul>
            </article>
            <!--star 底下按钮-->
            <div class="buy_height"></div>
            <div class="p_fotbtn tac"><a onclick="numberForm();" class="b-2db22d cf ptb25">提交申请</a></div>
            <form:errors path="name" cssClass="i_text"></form:errors>
            <form:input type="hidden" path="shopLogo" value="2"></form:input>
            <form:input type="hidden" path="shopServiceWx" value="3"></form:input>
            <form:input type="hidden" path="shopServiceQq" value="4"></form:input>
            <form:input type="hidden" path="shopServiceTel" value="5"></form:input>
        </form:form>
    </c:otherwise>
</c:choose>
</body>
</html>